feat(pegboard): expose rivet server from within containers for docker compose#2628
Closed
Conversation
This was referenced Jun 20, 2025
Member
Author
0a32a7f to
f56f348
Compare
046dd3e to
2a7b66a
Compare
Deploying rivet with
|
| Latest commit: |
eea0c38
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a648c09f.rivet.pages.dev |
| Branch Preview URL: | https://06-17-feat-pegboard-expose-r.rivet.pages.dev |
f56f348 to
7d71cc9
Compare
2a7b66a to
2b3a103
Compare
Comment on lines
+169
to
+171
| RIVET_SERVER_HOST="$(dig +short rivet-server)" | ||
| echo "Adding rule to forward $RIVET_SERVER_IPV4 to rivet-server ($RIVET_SERVER_HOST)" | ||
| add_ipt_rule "$ipt" "nat" "$NAT_CHAIN" "-d $RIVET_SERVER_IPV4 -j DNAT --to-destination $RIVET_SERVER_HOST" |
Contributor
There was a problem hiding this comment.
The DNS lookup for rivet-server lacks error handling. If the lookup fails, RIVET_SERVER_HOST will be empty, resulting in an invalid iptables rule (-j DNAT --to-destination ). Consider adding validation to ensure RIVET_SERVER_HOST contains a valid IP address before creating the rule:
RIVET_SERVER_HOST="$(dig +short rivet-server)"
if [ -z "$RIVET_SERVER_HOST" ]; then
echo "ERROR: Failed to resolve rivet-server hostname"
exit 1
fi
echo "Adding rule to forward $RIVET_SERVER_IPV4 to rivet-server ($RIVET_SERVER_HOST)"
add_ipt_rule "$ipt" "nat" "$NAT_CHAIN" "-d $RIVET_SERVER_IPV4 -j DNAT --to-destination $RIVET_SERVER_HOST"This ensures the script fails explicitly rather than creating a broken network configuration.
Suggested change
| RIVET_SERVER_HOST="$(dig +short rivet-server)" | |
| echo "Adding rule to forward $RIVET_SERVER_IPV4 to rivet-server ($RIVET_SERVER_HOST)" | |
| add_ipt_rule "$ipt" "nat" "$NAT_CHAIN" "-d $RIVET_SERVER_IPV4 -j DNAT --to-destination $RIVET_SERVER_HOST" | |
| RIVET_SERVER_HOST="$(dig +short rivet-server)" | |
| if [ -z "$RIVET_SERVER_HOST" ]; then | |
| echo "ERROR: Failed to resolve rivet-server hostname" | |
| exit 1 | |
| fi | |
| echo "Adding rule to forward $RIVET_SERVER_IPV4 to rivet-server ($RIVET_SERVER_HOST)" | |
| add_ipt_rule "$ipt" "nat" "$NAT_CHAIN" "-d $RIVET_SERVER_IPV4 -j DNAT --to-destination $RIVET_SERVER_HOST" |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
2b3a103 to
6fe1578
Compare
7d71cc9 to
38061b3
Compare
This was referenced Jun 20, 2025
This was referenced Jun 20, 2025
Deploying rivet-hub with
|
| Latest commit: |
eea0c38
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://55ee5baf.rivet-hub-7jb.pages.dev |
| Branch Preview URL: | https://06-17-feat-pegboard-expose-r.rivet-hub-7jb.pages.dev |
This was referenced Jun 21, 2025
Closed
38061b3 to
f07e495
Compare
6fe1578 to
8cc2d55
Compare
8cc2d55 to
eea0c38
Compare
f07e495 to
a130124
Compare
a130124 to
a38bee6
Compare
eea0c38 to
14ceb65
Compare
14ceb65 to
eea0c38
Compare
a38bee6 to
a130124
Compare
Contributor
Merge activity
|
graphite-app bot
pushed a commit
that referenced
this pull request
Jun 28, 2025
… compose (#2628) <!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changes